import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("rrz_site_links", { schema: "rrzcms" })
export class RrzSiteLinks {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("varchar", {
    name: "title",
    nullable: true,
    comment: "网站标题",
    length: 100,
  })
  title: string | null;

  @Column("varchar", {
    name: "url",
    nullable: true,
    comment: "网站地址",
    length: 255,
  })
  url: string | null;

  @Column("varchar", {
    name: "logo",
    nullable: true,
    comment: "网站LOGO",
    length: 255,
  })
  logo: string | null;

  @Column("int", {
    name: "sort",
    nullable: true,
    comment: "排序号",
    unsigned: true,
    default: () => "'0'",
  })
  sort: number | null;

  @Column("tinyint", {
    name: "target",
    nullable: true,
    comment: "是否新窗口打开",
    unsigned: true,
    default: () => "'0'",
  })
  target: number | null;

  @Column("varchar", { name: "email", nullable: true, length: 50 })
  email: string | null;

  @Column("text", { name: "intro", nullable: true, comment: "网站简况" })
  intro: string | null;

  @Column("tinyint", {
    name: "status",
    nullable: true,
    comment: "状态(1=显示，0=屏蔽)",
    unsigned: true,
    default: () => "'1'",
  })
  status: number | null;

  @Column("varchar", {
    name: "lang",
    nullable: true,
    comment: "语言标识",
    length: 50,
    default: () => "'cn'",
  })
  lang: string | null;

  @Column("int", {
    name: "add_time",
    nullable: true,
    comment: "新增时间",
    unsigned: true,
    default: () => "'0'",
  })
  addTime: number | null;

  @Column("int", {
    name: "update_time",
    nullable: true,
    comment: "更新时间",
    unsigned: true,
    default: () => "'0'",
  })
  updateTime: number | null;
}
